vim interactive mode AKA confirmation mode

In Vim, you can enter an interactive mode to replace blank lines one by one using “confirmation mode” in the :substitute command. Here’s how:

Command:

:g/^\s*$/c

Explanation:

Interactive Mode:

After running the command, Vim will prompt you for each blank line with options like:

replace with:

Then, you can:

Would you like a variation with an actual replacement text?